import React, { useState } from 'react';
import { Layout } from 'antd';
import { Outlet } from 'react-router-dom'
import MainMenu from '@/components/main/mainMenu';
import MainHeader from '@/components/main/mainHeader';
import MainProgress from '@/components/main/mainProgress';

const { Content, Sider } = Layout;

const Home: React.FC = () => {
  const [collapsed, setCollapsed] = useState(false);
  return (
    <Layout style={{ minHeight: '100vh' }}>
      <MainProgress />
      <MainHeader />
      <Layout>
        <Sider theme="light" collapsible collapsed={collapsed} onCollapse={(value) => setCollapsed(value)}>
          <MainMenu />
        </Sider>
        <Content style={{ margin: '16px' }}>
          <div style={{ padding: 24, height: '100%', background: "#fff" }}>
            <Outlet />
          </div>
        </Content>
      </Layout>
    </Layout>
  );
};

export default Home;